if ((wb_arg->wa_Name == NULL) || (*wb_arg->wa_Name == '\0') || (wb_arg->wa_Lock == NULL)) /* if this icon is a disk, directory or trashcan or the icon type does not supports locks */
continue; /* then, ignore the icon */
if (icon) /* if we have a previous icon taking up memory */
{
FreeDiskObject(icon); /* don't need the icon taking up memory anymore */
icon = NULL; /* note that it has been free'd */
}
CurrentDir(wb_arg->wa_Lock); /* switch to the icon's directory */
if ((icon = GetDiskObject(wb_arg->wa_Name)) == NULL) /* if we cannot get information on this icon */
continue; /* then, ignore the icon */
rvalue = FindToolType(icon->do_ToolTypes,dps_locale_string(DPS_ARG_PATH)); /* attempt to locate an alternate path to be scanned */
if (rvalue && (*rvalue == '\0')) /* if zero length string was specified */
DPSArgument[DPS_ARG_PATH] = NULL; /* use the current directory */
else
DPSArgument[DPS_ARG_PATH] = rvalue; /* otherwise use specified or non-existant path */
rvalue = FindToolType(icon->do_ToolTypes,dps_locale_string(DPS_ARG_PROJECT)); /* attempt to get the name of our project from the icon */
if ((rvalue == NULL) || (rvalue[0] == '\0')) /* if no project was supplied */
{
DPSArgument[DPS_ARG_PROJECT] = NULL; /* start with no project name */
parse_scoptions_for_project(); /* maybe the answer is in the scoptions file */
if (DPSArgument[DPS_ARG_PROJECT] == NULL) /* if we still don't have a project name */
DPSArgument[DPS_ARG_PROJECT] = DPS_DEFAULT_PROJECT; /* then, use the default name */
}
else /* a project name was supplied */
{
DPSArgument[DPS_ARG_PROJECT] = rvalue; /* use the project name from the icon */
}
rvalue = FindToolType(icon->do_ToolTypes,dps_locale_string(DPS_ARG_MATCH)); /* search for the file pattern specifier */
if (rvalue && *rvalue) /* if a valid file pattern was specified */
DPSArgument[DPS_ARG_MATCH] = rvalue; /* use the specified file pattern */
else /* nothing specified */
DPSArgument[DPS_ARG_MATCH] = DPS_DEFAULT_MATCH; /* use the default value */
rvalue = FindToolType(icon->do_ToolTypes,dps_locale_string(DPS_ARG_MAKEFILE)); /* search for the name of the makefile */
if (rvalue && *rvalue) /* if a valid value was specified */
DPSArgument[DPS_ARG_MAKEFILE] = rvalue; /* use the specified value */
else /* nothing specified */
DPSArgument[DPS_ARG_MAKEFILE] = DPS_DEFAULT_MAKEFILE; /* use the default value */
rvalue = FindToolType(icon->do_ToolTypes,dps_locale_string(DPS_ARG_RULES)); /* search for the name of a file to be inserted into the makefile */
if (rvalue && *rvalue) /* if a valid value was specified */
DPSArgument[DPS_ARG_RULES] = rvalue; /* use the specified value */
else /* nothing specified */
DPSArgument[DPS_ARG_RULES] = NULL; /* use the default value */
rvalue = FindToolType(icon->do_ToolTypes,dps_locale_string(DPS_ARG_OBJECT_DIR)); /* search for the name of the object file directory */
if ((rvalue == NULL) || (rvalue[0] == '\0')) /* if no object directory was specified */
{
DPSArgument[DPS_ARG_OBJECT_DIR] = NULL; /* start with no object directory */
parse_scoptions_for_object_dir(); /* try to get the object directory from the scoptions file */
if (DPSArgument[DPS_ARG_OBJECT_DIR] == NULL) /* if we still don't have an object directory name */
DPSArgument[DPS_ARG_OBJECT_DIR] = DPS_DEFAULT_OBJECT_DIR; /* use the default object directory name */
}
else /* an object directory was specified */
{
DPSArgument[DPS_ARG_OBJECT_DIR] = rvalue; /* use the specified value */
}
rvalue = FindToolType(icon->do_ToolTypes,dps_locale_string(DPS_ARG_FILESONLINE)); /* search for the maximum number of files per line in the makefile */
if (rvalue && *rvalue && atoi(rvalue)) /* if a valid value was specified */
files_on_line = atoi(rvalue); /* use the specified value */
else /* nothing specified */
files_on_line = DPS_DEFAULT_FILESONLINE; /* use the default number of files per line */
DPSArgument[DPS_ARG_FILESONLINE] = (char *)&files_on_line; /* always use our number of filesonline */
rvalue = FindToolType(icon->do_ToolTypes,dps_locale_string(DPS_ARG_FROM)); /* search for the bit of text that follows the linker FROM keyword */
if (rvalue && *rvalue) /* if a valid value was specified */
DPSArgument[DPS_ARG_FROM] = rvalue; /* use the specified value */
else /* nothing specified */
DPSArgument[DPS_ARG_FROM] = DPS_DEFAULT_FROM; /* use the default value */
rvalue = FindToolType(icon->do_ToolTypes,dps_locale_string(DPS_ARG_LIBRARY)); /* search for the libraries to be included */
if (rvalue && *rvalue) /* if a valid value was specified */
DPSArgument[DPS_ARG_LIBRARY] = rvalue; /* use the specified value */
else /* nothing specified */
DPSArgument[DPS_ARG_LIBRARY] = DPS_DEFAULT_LIBRARY; /* use the default value */
rvalue = FindToolType(icon->do_ToolTypes,dps_locale_string(DPS_ARG_VERBOSE)); /* search for the verbose switch */
if (rvalue) /* if the keyword exists */
DPSArgument[DPS_ARG_VERBOSE] = (char *)(TRUE); /* note that it exists */
else /* nothing specified */
DPSArgument[DPS_ARG_VERBOSE] = (char *)(FALSE); /* use the default value */
if ((retval = dependant_scan()) != 0) /* if we have trouble doing this scan */
break; /* then, we are outta here */
}
_ABORT:
if (icon) /* if we have an icon taking up memory */
FreeDiskObject(icon); /* don't need the icon taking up memory */
CurrentDir(startup_directory); /* switch back to the startup directory */